home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH13 / 13-2-3.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-18  |  1.8 KB  |  60 lines

  1. VERSION 5.00
  2. Begin VB.Form frmCircles 
  3.    BorderStyle     =   0  'None
  4.    ClientHeight    =   4245
  5.    ClientLeft      =   0
  6.    ClientTop       =   0
  7.    ClientWidth     =   3840
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   4245
  10.    ScaleWidth      =   3840
  11.    ShowInTaskbar   =   0   'False
  12.    StartUpPosition =   3  'Windows Default
  13.    Begin VB.CommandButton cmdQuit 
  14.       Caption         =   "Quit"
  15.       Height          =   495
  16.       Left            =   2640
  17.       TabIndex        =   2
  18.       Top             =   1200
  19.       Width           =   1095
  20.    End
  21.    Begin VB.CommandButton cmdMove 
  22.       Caption         =   "Move and Show Circle"
  23.       Height          =   495
  24.       Left            =   1560
  25.       TabIndex        =   0
  26.       Top             =   120
  27.       Width           =   2175
  28.    End
  29.    Begin VB.Label lblCaution 
  30.       BorderStyle     =   1  'Fixed Single
  31.       Height          =   375
  32.       Left            =   2040
  33.       TabIndex        =   1
  34.       Top             =   720
  35.       Width           =   1695
  36.    End
  37. Attribute VB_Name = "frmCircles"
  38. Attribute VB_GlobalNameSpace = False
  39. Attribute VB_Creatable = False
  40. Attribute VB_PredeclaredId = True
  41. Attribute VB_Exposed = False
  42. Private WithEvents round As CCircle
  43. Attribute round.VB_VarHelpID = -1
  44. Private Sub Form_Load()
  45.   Set round = New CCircle
  46. End Sub
  47. Private Sub cmdMove_Click()
  48.   round.Move (500)
  49. End Sub
  50. Private Sub round_PositionChanged(x As Integer, y As Integer, r As Single)
  51.   'This event is triggered when the center of the circle changes.
  52.   If (x + r > frmCircles.Width) Or (y + r > frmCircles.Height) Then
  53.       lblCaution.Caption = "Circle Off Screen"
  54.       frmCircles.ForeColor = vbRed  'Make future circles red
  55.   End If
  56. End Sub
  57. Private Sub cmdQuit_Click()
  58.   End
  59. End Sub
  60.